/**
 *
 */
package com.zhuoyue.elmt.service;

import com.eit.eitsite.common.persistence.Page;
import com.eit.eitsite.common.service.CrudService;
import com.eit.eitsite.common.utils.StringUtils;
import com.google.common.collect.Lists;
import com.zhuoyue.elmt.dao.XtPqDao;
import com.zhuoyue.elmt.dao.XtPqxqgxDao;
import com.zhuoyue.elmt.entity.WbMtGroupStaff;
import com.zhuoyue.elmt.entity.XtPq;
import com.zhuoyue.elmt.entity.XtPqxqgx;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;

/**
 * 设备分组Service
 *
 * @author JiangYH
 * @version 2017-02-09
 */
@Service
@Transactional(readOnly = true)
public class XtPqxqgxService extends CrudService<XtPqxqgxDao, XtPqxqgx> {

    @Autowired
    XtPqDao xtPqDao;

    @Transactional(readOnly = false)
    public void save(List<XtPqxqgx> xtPqxqgxList) {
        for (XtPqxqgx xtPqxqgx : xtPqxqgxList) {
            super.save(xtPqxqgx);
        }
    }

    @Transactional(readOnly = false)
    public void deleterela(List<XtPqxqgx> xtPqxqgxList) {
        for (XtPqxqgx xtPqxqgx : xtPqxqgxList) {
            dao.deleterela(xtPqxqgx);
        }

//        HashMap paramMap = new HashMap();
//        paramMap.put("in_pq_id", xtPq.getPqId());
//        paramMap.put("in_wbdwdm", xtPq.getMaintenUnitCode());
//        paramMap.put("in_delete_pq_id", "0");
//        xtPqDao.updateStaffDevice(paramMap);
    }


    @Transactional(readOnly = false)
    public void saveUpdateDevice(XtPq xtPq, List<XtPqxqgx> xtPqxqgxList) {
        for (XtPqxqgx xtPqxqgx : xtPqxqgxList) {
            super.save(xtPqxqgx);
        }
//        HashMap paramMap = new HashMap();
//        paramMap.put("in_pq_id", xtPq.getPqId());
//        paramMap.put("in_wbdwdm", xtPq.getMaintenUnitCode());
//        paramMap.put("in_delete_pq_id", "0");
//        xtPqDao.updateStaffDevice(paramMap);
    }

    public String findXqList(XtPqxqgx xtPqxqgx){
       return dao.findXqList(xtPqxqgx);
    }
}